package com.bluecoffee.rest;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * Created by qianlong on 16/9/2.
 */
@RestController
public class HelloWorldController {

    @Value("${com.bluecoffee.space.author}")
    private String blogAuthor;

    @Value("${com.bluecoffee.space.title}")
    private String blogTitle;

    @RequestMapping(value = "/sayHello", method = RequestMethod.POST, produces = "application/json")
    public HashMap<String,String> sayHello(@RequestParam String username) throws Exception{
        HashMap<String,String> map = new HashMap<String,String>();
        map.put("visitor",username);
        map.put("blogAuthor",blogAuthor);
        map.put("blogTitle",blogTitle);
        return map;
    }

}
